package com.hison.courseselectionsystem.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 
 * @TableName teacher
 */
@TableName(value ="teacher")
@Data
@ApiModel(value = "teacher",description = "教师信息表")
public class Teacher implements Serializable {
    /**
     * 教师的唯一标识符
     */
    @TableId
    @ApiModelProperty(value = "主键")
    private Integer id;

    /**
     * 教师的姓名
     */
    @ApiModelProperty("教师姓名")
    private String name;

    /**
     * 教师的性别
     */
    @ApiModelProperty("教师性别")
    private String gender;

    /**
     * 教师编号
     */
    @ApiModelProperty("教师编号")
    private String teacherId;

    /**
     * 教师密码
     */
    @ApiModelProperty("教师密码")
    private String pwd;

    /**
     * 教师的出生日期
     */
    @ApiModelProperty("教师的出生日期")
    private Date birthDate;

    /**
     * 教师的年龄，必须大于等于18岁且小于等于100岁
     */
    @ApiModelProperty("教师的年龄")
    private Integer age;

    /**
     * 教师的工资
     */
    @ApiModelProperty("教师的工资")
    private BigDecimal salary;

    /**
     * 其他描述
     */
    @ApiModelProperty("其他描述")
    private String description;

    @ApiModelProperty("教授学生列表")
    @TableField(exist = false)
    private List<Student> students;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Teacher other = (Teacher) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getGender() == null ? other.getGender() == null : this.getGender().equals(other.getGender()))
            && (this.getTeacherId() == null ? other.getTeacherId() == null : this.getTeacherId().equals(other.getTeacherId()))
            && (this.getPwd() == null ? other.getPwd() == null : this.getPwd().equals(other.getPwd()))
            && (this.getBirthDate() == null ? other.getBirthDate() == null : this.getBirthDate().equals(other.getBirthDate()))
            && (this.getAge() == null ? other.getAge() == null : this.getAge().equals(other.getAge()))
            && (this.getSalary() == null ? other.getSalary() == null : this.getSalary().equals(other.getSalary()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getGender() == null) ? 0 : getGender().hashCode());
        result = prime * result + ((getTeacherId() == null) ? 0 : getTeacherId().hashCode());
        result = prime * result + ((getPwd() == null) ? 0 : getPwd().hashCode());
        result = prime * result + ((getBirthDate() == null) ? 0 : getBirthDate().hashCode());
        result = prime * result + ((getAge() == null) ? 0 : getAge().hashCode());
        result = prime * result + ((getSalary() == null) ? 0 : getSalary().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", gender=").append(gender);
        sb.append(", teacherId=").append(teacherId);
        sb.append(", pwd=").append(pwd);
        sb.append(", birthDate=").append(birthDate);
        sb.append(", age=").append(age);
        sb.append(", salary=").append(salary);
        sb.append(", description=").append(description);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}